package io.github.uicdb.flame_driven;

import com.mojang.logging.LogUtils;
import io.github.noeppi_noeppi.libx.config.ConfigManager;
import io.github.noeppi_noeppi.libx.mod.registration.ModXRegistration;
import io.github.noeppi_noeppi.libx.mod.registration.RegistrationBuilder;
import io.github.uicdb.flame_driven.client.ModClientEventHandle;
import io.github.uicdb.flame_driven.common.ModRegisteries;
import io.github.uicdb.flame_driven.common.recipe.ModRecipes;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;

// The value here should match an entry in the META-INF/mods.toml file
@Mod(ModUtil.MODID)
public final class FlameDriven extends ModXRegistration {
    public static FlameDriven instance;
    public FlameDriven(){
        super(new CreativeModeTab("tab.flame_driven") {
            @NotNull
            @Override
            public ItemStack makeIcon() {
                return ModRegisteries.kinding.getDefaultInstance();
            }
        });
        instance=this;
    }
    public static FlameDriven getInstance() {
        return instance;
    }
    // Directly reference a slf4j logger
    private static final Logger LOGGER = LogUtils.getLogger();

    @Override
    protected void initRegistration(RegistrationBuilder builder) {
        builder.setVersion(0);
    }

    @Override
    protected void setup(FMLCommonSetupEvent event) {
        event.enqueueWork(()->ConfigManager.registerConfig(modid,ModConfig.class,false));
        event.enqueueWork(ModRecipes::registerType);
    }

    @OnlyIn(Dist.CLIENT)
    @Override
    protected void clientSetup(FMLClientSetupEvent event) {
        ModClientEventHandle.initClient(event);
    }

    public static class RegistryEvents {

    }
}
